package sf.event.service;


import java.util.Collection;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import sf.event.dao.EventDao;
import sf.event.model.Event;

@Service
public class EventService
{

  @Autowired
  private EventDao eventDao;

  @Transactional
  public void delete(final long id)
  {
    final Event event = eventDao.find(id);
    eventDao.delete(event);
  }

  public Event find(final long id)
  {
    return eventDao.find(id);
  }

  public Collection<Event> findAll()
  {
    return eventDao.findAll();
  }

  @Transactional
  public void save(final Event event)
  {
    eventDao.save(event);
  }

  @Transactional
  public void update(final Event event)
  {
    eventDao.update(event);
  }

}
